#include "Model3d.h"

namespace Geometry
  {
  typedef Model3d::PointIterator TPointIterator; 

  TPointIterator::PointIterator(std::list<Point3d>::const_iterator i_iterator)
    : m_iteator(i_iterator)
    {
    }

  TPointIterator& TPointIterator::operator++()
    {
    ++m_iteator;
    return *this;
    }

  TPointIterator TPointIterator::operator++(int)
    {
    TPointIterator temp = *this;
    ++*this;
    return temp;
    }

  bool TPointIterator::operator!=(const TPointIterator& i_other) const
    {
    return m_iteator != i_other.m_iteator;
    }

  const Point3d& TPointIterator::operator*() const 
    {
    return *m_iteator;
    }

  
  Point3d* Model3d::AddPoint(double i_x, double i_y, double i_z)
    {
    //m_points.push_back(Point3d(i_x, i_y, i_z));
    Point3d p(i_x, i_y, i_z);
    m_points.push_back(std::move(p));

    return &m_points.back();
    }

  TPointIterator Model3d::BeginPoint() const
    {
    return TPointIterator(m_points.begin());
    }

  TPointIterator Model3d::EndPoint() const
    {
    return TPointIterator(m_points.end());
    }

  }

